<template>
	<!-- ${tableComment} -->
	<div class="main-container">
		<!-- ${tableComment}列表页面 -->
		<TabList
			:refreshList="refreshList"
			:key="datekey"
			@openContent="openContent"
		></TabList>
		<!-- ${tableComment}新增 -->
		<TabInit
			:oprType="oprType"
			:rowInfo="activeRow"
			@backList="backList"
		></TabInit>
	</div>
</template>

<script>
    import TabList from "./list.vue"; // 列表页面
    import TabInit from "./form.vue"; // 新增/编辑
    export default {
        name: "${ClassName}Index",
        components: {
            TabList,
            TabInit,
        },
        data() {
            return {
                datekey: new Date().getTime(), //组件 key
                oprType: "", // 当前状态（add添加 edit编辑 check审核 detail查看）
                activeRow: {}, // 列表当前活动行
                refreshList: false, // 是否刷新列表
            };
        },
        computed: {},
        watch: {},
        created() {
        },
        mounted() {
        },
        methods: {
            openContent(oprType, row) {
                /* 参数说明
								项目列表子组件的传参
								oprType 操作类型 add添加 edit编辑 check审核
								row 操作数据的内容
								*/
                this.oprType = oprType;
                this.activeRow = row;
            },
            backList(backType, closeTag) {
                this.oprType = "";
                if (closeTag === "close") {
                    return;
                }
                this.refreshList = !this.refreshList;
            },
        },
    };
</script>

<style lang="less" scoped></style>
